package com.tanhua.server.controller;

import com.tanhua.server.interceptors.UserHolder;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/huanxin")
public class HuanXinController {

    @GetMapping("/user")
    public ResponseEntity huanxinUser(){
        Map<String,String> map = new HashMap();
        map.put("username", UserHolder.getUserId().toString()); //在环信中我们在username的位置放的是userId
        map.put("password","123456");  // 密码是写死了
        return ResponseEntity.ok(map);
    }

}
